package com.sanyang.lawyer.mapper.audit;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sanyang.lawyer.entity.Audit;
import com.sanyang.lawyer.entity.Case_audit;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface Audit_sealMapper extends BaseMapper<Case_audit> {
    
    //添加审核表数据
    @Insert("insert into audit (auditid,submitid,remark,typeid,submit_time,state)" +
            " values(#{auditid},#{submitid.userId}," +
            "#{remark},#{typeid.typeid},#{submitTime}," +
            "#{state})")
    public void insertInAudit(Audit audit);
    
    //添加中间表数据
    @Insert("insert into case_audit (caseid,auditid,seal_type)" +
            "values(#{caseid.caseId},#{auditid.auditid},#{sealType})")
    public void insertInCase_Audit(Case_audit case_audit);


    //根据流程id查询出用印审核相关的内容
    public Case_audit querySealByprocessid(String processid);

    //完成审核修改数据
    @Update("update audit set audit_time = #{auditTime}, audit_userid=#{auditUserid.userId}," +
            " comment = #{comment},if_pass = #{if_pass}" +
            "where auditid = #{auditid}")
    public void complateUpdate(Audit audit);
    
    
}
